package com.knowledge.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.knowledge.dao.entity.SysUser;
import com.knowledge.vo.Result;
import com.knowledge.vo.UserVo;
import com.knowledge.vo.params.ChangePwdParam;
import com.knowledge.vo.params.SetAdminParam;


/**
 * @author zzz
 * @create 2022-02-10 17:32
 */
public interface SysUserService extends IService<SysUser> {
    SysUser findUserById(Long id);

    SysUser findUser(String account, String password);

    /**
     * 根据token 查询用户信息
     * @param token
     * @return
     */
    Result findUserByToken(String token);

    /**
     * 根据账户查找用户
     * @param account
     * @return
     */
    SysUser findUserByAccount(String account);

    /**
     * 验证token
     * @param token
     * @return
     */
    SysUser checkToken(String token);

    UserVo findUserVoById(Long authorId);
    
     /**
     　* @description: 初始化有效用户
     　* @param ${tags}
     　* @return ${return_type}
     　* @throws
     　* @author zzz
     　* @date 2022-03-05 18:51
     */
     void initEffectiveUser();

    Result changePassword(ChangePwdParam changePwdParam);

    Result setAdmin(SetAdminParam userId);
}
